Integrand size = 30, antiderivative size = 484 \[ \int \frac {a-c+b x}{\left (1+x^2\right ) \sqrt {a+b x+c x^2}} \, dx=-\frac {\sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \arctan \left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}-\left (b^2+(a-c) \left (a-c+\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) x}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c-\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c-\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b x+c x^2}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2}}-\frac {\sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \text {arctanh}\left (\frac {b \sqrt {a^2+b^2-2 a c+c^2}+\left (b^2+(a-c) \left (a-c-\sqrt {a^2+b^2-2 a c+c^2}\right )\right ) x}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2} \sqrt {a^2+b^2+c \left (c+\sqrt {a^2+b^2-2 a c+c^2}\right )-a \left (2 c+\sqrt {a^2+b^2-2 a c+c^2}\right )} \sqrt {a+b x+c x^2}}\right )}{\sqrt {2} \sqrt [4]{a^2+b^2-2 a c+c^2}} \]
-1/2*arctan(1/2*(b*(a^2-2*a*c+b^2+c^2)^(1/2)-x*(b^2+(a-c)*(a-c+(a^2-2*a*c+ b^2+c^2)^(1/2))))/(a^2-2*a*c+b^2+c^2)^(1/4)*2^(1/2)/(c*x^2+b*x+a)^(1/2)/(a ^2+b^2+c*(c-(a^2-2*a*c+b^2+c^2)^(1/2))-a*(2*c-(a^2-2*a*c+b^2+c^2)^(1/2)))^ (1/2))*(a^2+b^2+c*(c-(a^2-2*a*c+b^2+c^2)^(1/2))-a*(2*c-(a^2-2*a*c+b^2+c^2) ^(1/2)))^(1/2)/(a^2-2*a*c+b^2+c^2)^(1/4)*2^(1/2)-1/2*arctanh(1/2*(x*(b^2+( a-c)*(a-c-(a^2-2*a*c+b^2+c^2)^(1/2)))+b*(a^2-2*a*c+b^2+c^2)^(1/2))/(a^2-2* a*c+b^2+c^2)^(1/4)*2^(1/2)/(c*x^2+b*x+a)^(1/2)/(a^2+b^2+c*(c+(a^2-2*a*c+b^ 2+c^2)^(1/2))-a*(2*c+(a^2-2*a*c+b^2+c^2)^(1/2)))^(1/2))*(a^2+b^2+c*(c+(a^2 -2*a*c+b^2+c^2)^(1/2))-a*(2*c+(a^2-2*a*c+b^2+c^2)^(1/2)))^(1/2)/(a^2-2*a*c +b^2+c^2)^(1/4)*2^(1/2)
Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.
Time = 0.36 (sec) , antiderivative size = 210, normalized size of antiderivative = 0.43 \[ \int \frac {a-c+b x}{\left (1+x^2\right ) \sqrt {a+b x+c x^2}} \, dx=\frac {1}{2} \text {RootSum}\left [a^2+b^2-4 b \sqrt {c} \text {$\#$1}-2 a \text {$\#$1}^2+4 c \text {$\#$1}^2+\text {$\#$1}^4\&,\frac {b c \log \left (-\sqrt {c} x+\sqrt {a+b x+c x^2}-\text {$\#$1}\right )+2 a \sqrt {c} \log \left (-\sqrt {c} x+\sqrt {a+b x+c x^2}-\text {$\#$1}\right ) \text {$\#$1}-2 c^{3/2} \log \left (-\sqrt {c} x+\sqrt {a+b x+c x^2}-\text {$\#$1}\right ) \text {$\#$1}-b \log \left (-\sqrt {c} x+\sqrt {a+b x+c x^2}-\text {$\#$1}\right ) \text {$\#$1}^2}{b \sqrt {c}+a \text {$\#$1}-2 c \text {$\#$1}-\text {$\#$1}^3}\&\right ] \]
RootSum[a^2 + b^2 - 4*b*Sqrt[c]*#1 - 2*a*#1^2 + 4*c*#1^2 + #1^4 & , (b*c*L og[-(Sqrt[c]*x) + Sqrt[a + b*x + c*x^2] - #1] + 2*a*Sqrt[c]*Log[-(Sqrt[c]* x) + Sqrt[a + b*x + c*x^2] - #1]*#1 - 2*c^(3/2)*Log[-(Sqrt[c]*x) + Sqrt[a + b*x + c*x^2] - #1]*#1 - b*Log[-(Sqrt[c]*x) + Sqrt[a + b*x + c*x^2] - #1] *#1^2)/(b*Sqrt[c] + a*#1 - 2*c*#1 - #1^3) & ]/2
Time = 28.43 (sec) , antiderivative size = 552, normalized size of antiderivative = 1.14, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {1369, 25, 1363, 218, 221}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {a+b x-c}{\left (x^2+1\right ) \sqrt {a+b x+c x^2}} \, dx\) |
\(\Big \downarrow \) 1369 |
\(\displaystyle \frac {\int -\frac {b^2-\sqrt {a^2-2 c a+b^2+c^2} x b+(a-c) \left (a-c-\sqrt {a^2-2 c a+b^2+c^2}\right )}{\left (x^2+1\right ) \sqrt {c x^2+b x+a}}dx}{2 \sqrt {a^2-2 a c+b^2+c^2}}-\frac {\int -\frac {b^2+\sqrt {a^2-2 c a+b^2+c^2} x b+(a-c) \left (a-c+\sqrt {a^2-2 c a+b^2+c^2}\right )}{\left (x^2+1\right ) \sqrt {c x^2+b x+a}}dx}{2 \sqrt {a^2-2 a c+b^2+c^2}}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {\int \frac {b^2+\sqrt {a^2-2 c a+b^2+c^2} x b+(a-c) \left (a-c+\sqrt {a^2-2 c a+b^2+c^2}\right )}{\left (x^2+1\right ) \sqrt {c x^2+b x+a}}dx}{2 \sqrt {a^2-2 a c+b^2+c^2}}-\frac {\int \frac {b^2-\sqrt {a^2-2 c a+b^2+c^2} x b+(a-c) \left (a-c-\sqrt {a^2-2 c a+b^2+c^2}\right )}{\left (x^2+1\right ) \sqrt {c x^2+b x+a}}dx}{2 \sqrt {a^2-2 a c+b^2+c^2}}\) |
\(\Big \downarrow \) 1363 |
\(\displaystyle -b \left ((a-c) \left (-\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right ) \int \frac {1}{\frac {b \left (\sqrt {a^2-2 c a+b^2+c^2} b+\left (b^2+(a-c) \left (a-c-\sqrt {a^2-2 c a+b^2+c^2}\right )\right ) x\right )^2}{c x^2+b x+a}-2 b \sqrt {a^2-2 c a+b^2+c^2} \left (b^2+(a-c) \left (a-c-\sqrt {a^2-2 c a+b^2+c^2}\right )\right )}d\left (-\frac {\sqrt {a^2-2 c a+b^2+c^2} b+\left (b^2+(a-c) \left (a-c-\sqrt {a^2-2 c a+b^2+c^2}\right )\right ) x}{\sqrt {c x^2+b x+a}}\right )-b \left ((a-c) \left (\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right ) \int \frac {1}{\frac {b \left (b \sqrt {a^2-2 c a+b^2+c^2}-\left (b^2+(a-c) \left (a-c+\sqrt {a^2-2 c a+b^2+c^2}\right )\right ) x\right )^2}{c x^2+b x+a}+2 b \sqrt {a^2-2 c a+b^2+c^2} \left (b^2+(a-c) \left (a-c+\sqrt {a^2-2 c a+b^2+c^2}\right )\right )}d\frac {b \sqrt {a^2-2 c a+b^2+c^2}-\left (b^2+(a-c) \left (a-c+\sqrt {a^2-2 c a+b^2+c^2}\right )\right ) x}{\sqrt {c x^2+b x+a}}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle -b \left ((a-c) \left (-\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right ) \int \frac {1}{\frac {b \left (\sqrt {a^2-2 c a+b^2+c^2} b+\left (b^2+(a-c) \left (a-c-\sqrt {a^2-2 c a+b^2+c^2}\right )\right ) x\right )^2}{c x^2+b x+a}-2 b \sqrt {a^2-2 c a+b^2+c^2} \left (b^2+(a-c) \left (a-c-\sqrt {a^2-2 c a+b^2+c^2}\right )\right )}d\left (-\frac {\sqrt {a^2-2 c a+b^2+c^2} b+\left (b^2+(a-c) \left (a-c-\sqrt {a^2-2 c a+b^2+c^2}\right )\right ) x}{\sqrt {c x^2+b x+a}}\right )-\frac {\left ((a-c) \left (\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right ) \arctan \left (\frac {b \sqrt {a^2-2 a c+b^2+c^2}-x \left ((a-c) \left (\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right )}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2} \sqrt {-a \left (2 c-\sqrt {a^2-2 a c+b^2+c^2}\right )+c \left (c-\sqrt {a^2-2 a c+b^2+c^2}\right )+a^2+b^2} \sqrt {a+b x+c x^2}}\right )}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2} \sqrt {-a \left (2 c-\sqrt {a^2-2 a c+b^2+c^2}\right )+c \left (c-\sqrt {a^2-2 a c+b^2+c^2}\right )+a^2+b^2}}\) |
\(\Big \downarrow \) 221 |
\(\displaystyle -\frac {\left ((a-c) \left (\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right ) \arctan \left (\frac {b \sqrt {a^2-2 a c+b^2+c^2}-x \left ((a-c) \left (\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right )}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2} \sqrt {-a \left (2 c-\sqrt {a^2-2 a c+b^2+c^2}\right )+c \left (c-\sqrt {a^2-2 a c+b^2+c^2}\right )+a^2+b^2} \sqrt {a+b x+c x^2}}\right )}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2} \sqrt {-a \left (2 c-\sqrt {a^2-2 a c+b^2+c^2}\right )+c \left (c-\sqrt {a^2-2 a c+b^2+c^2}\right )+a^2+b^2}}-\frac {\left ((a-c) \left (-\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right ) \text {arctanh}\left (\frac {x \left ((a-c) \left (-\sqrt {a^2-2 a c+b^2+c^2}+a-c\right )+b^2\right )+b \sqrt {a^2-2 a c+b^2+c^2}}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2} \sqrt {-a \left (\sqrt {a^2-2 a c+b^2+c^2}+2 c\right )+c \left (\sqrt {a^2-2 a c+b^2+c^2}+c\right )+a^2+b^2} \sqrt {a+b x+c x^2}}\right )}{\sqrt {2} \sqrt [4]{a^2-2 a c+b^2+c^2} \sqrt {-a \left (\sqrt {a^2-2 a c+b^2+c^2}+2 c\right )+c \left (\sqrt {a^2-2 a c+b^2+c^2}+c\right )+a^2+b^2}}\) |
-(((b^2 + (a - c)*(a - c + Sqrt[a^2 + b^2 - 2*a*c + c^2]))*ArcTan[(b*Sqrt[ a^2 + b^2 - 2*a*c + c^2] - (b^2 + (a - c)*(a - c + Sqrt[a^2 + b^2 - 2*a*c + c^2]))*x)/(Sqrt[2]*(a^2 + b^2 - 2*a*c + c^2)^(1/4)*Sqrt[a^2 + b^2 + c*(c - Sqrt[a^2 + b^2 - 2*a*c + c^2]) - a*(2*c - Sqrt[a^2 + b^2 - 2*a*c + c^2] )]*Sqrt[a + b*x + c*x^2])])/(Sqrt[2]*(a^2 + b^2 - 2*a*c + c^2)^(1/4)*Sqrt[ a^2 + b^2 + c*(c - Sqrt[a^2 + b^2 - 2*a*c + c^2]) - a*(2*c - Sqrt[a^2 + b^ 2 - 2*a*c + c^2])])) - ((b^2 + (a - c)*(a - c - Sqrt[a^2 + b^2 - 2*a*c + c ^2]))*ArcTanh[(b*Sqrt[a^2 + b^2 - 2*a*c + c^2] + (b^2 + (a - c)*(a - c - S qrt[a^2 + b^2 - 2*a*c + c^2]))*x)/(Sqrt[2]*(a^2 + b^2 - 2*a*c + c^2)^(1/4) *Sqrt[a^2 + b^2 + c*(c + Sqrt[a^2 + b^2 - 2*a*c + c^2]) - a*(2*c + Sqrt[a^ 2 + b^2 - 2*a*c + c^2])]*Sqrt[a + b*x + c*x^2])])/(Sqrt[2]*(a^2 + b^2 - 2* a*c + c^2)^(1/4)*Sqrt[a^2 + b^2 + c*(c + Sqrt[a^2 + b^2 - 2*a*c + c^2]) - a*(2*c + Sqrt[a^2 + b^2 - 2*a*c + c^2])])
3.1.12.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x /Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
Int[((g_) + (h_.)*(x_))/(((a_) + (c_.)*(x_)^2)*Sqrt[(d_.) + (e_.)*(x_) + (f _.)*(x_)^2]), x_Symbol] :> Simp[-2*a*g*h Subst[Int[1/Simp[2*a^2*g*h*c + a *e*x^2, x], x], x, Simp[a*h - g*c*x, x]/Sqrt[d + e*x + f*x^2]], x] /; FreeQ [{a, c, d, e, f, g, h}, x] && EqQ[a*h^2*e + 2*g*h*(c*d - a*f) - g^2*c*e, 0]
Int[((g_.) + (h_.)*(x_))/(((a_) + (c_.)*(x_)^2)*Sqrt[(d_.) + (e_.)*(x_) + ( f_.)*(x_)^2]), x_Symbol] :> With[{q = Rt[(c*d - a*f)^2 + a*c*e^2, 2]}, Simp [1/(2*q) Int[Simp[(-a)*h*e - g*(c*d - a*f - q) + (h*(c*d - a*f + q) - g*c *e)*x, x]/((a + c*x^2)*Sqrt[d + e*x + f*x^2]), x], x] - Simp[1/(2*q) Int[ Simp[(-a)*h*e - g*(c*d - a*f + q) + (h*(c*d - a*f - q) - g*c*e)*x, x]/((a + c*x^2)*Sqrt[d + e*x + f*x^2]), x], x]] /; FreeQ[{a, c, d, e, f, g, h}, x] && NeQ[e^2 - 4*d*f, 0] && NegQ[(-a)*c]
result has leaf size over 500,000. Avoiding possible recursion issues.
Time = 116.44 (sec) , antiderivative size = 6870946, normalized size of antiderivative = 14196.17
Time = 0.37 (sec) , antiderivative size = 307, normalized size of antiderivative = 0.63 \[ \int \frac {a-c+b x}{\left (1+x^2\right ) \sqrt {a+b x+c x^2}} \, dx=-\frac {1}{4} \, \sqrt {-a + c + \sqrt {-b^{2}}} \log \left (\frac {2 \, b c x + 2 \, \sqrt {c x^{2} + b x + a} \sqrt {-a + c + \sqrt {-b^{2}}} b + b^{2} + \sqrt {-b^{2}} {\left (b x + 2 \, a\right )}}{x}\right ) + \frac {1}{4} \, \sqrt {-a + c + \sqrt {-b^{2}}} \log \left (\frac {2 \, b c x - 2 \, \sqrt {c x^{2} + b x + a} \sqrt {-a + c + \sqrt {-b^{2}}} b + b^{2} + \sqrt {-b^{2}} {\left (b x + 2 \, a\right )}}{x}\right ) - \frac {1}{4} \, \sqrt {-a + c - \sqrt {-b^{2}}} \log \left (\frac {2 \, b c x + 2 \, \sqrt {c x^{2} + b x + a} \sqrt {-a + c - \sqrt {-b^{2}}} b + b^{2} - \sqrt {-b^{2}} {\left (b x + 2 \, a\right )}}{x}\right ) + \frac {1}{4} \, \sqrt {-a + c - \sqrt {-b^{2}}} \log \left (\frac {2 \, b c x - 2 \, \sqrt {c x^{2} + b x + a} \sqrt {-a + c - \sqrt {-b^{2}}} b + b^{2} - \sqrt {-b^{2}} {\left (b x + 2 \, a\right )}}{x}\right ) \]
-1/4*sqrt(-a + c + sqrt(-b^2))*log((2*b*c*x + 2*sqrt(c*x^2 + b*x + a)*sqrt (-a + c + sqrt(-b^2))*b + b^2 + sqrt(-b^2)*(b*x + 2*a))/x) + 1/4*sqrt(-a + c + sqrt(-b^2))*log((2*b*c*x - 2*sqrt(c*x^2 + b*x + a)*sqrt(-a + c + sqrt (-b^2))*b + b^2 + sqrt(-b^2)*(b*x + 2*a))/x) - 1/4*sqrt(-a + c - sqrt(-b^2 ))*log((2*b*c*x + 2*sqrt(c*x^2 + b*x + a)*sqrt(-a + c - sqrt(-b^2))*b + b^ 2 - sqrt(-b^2)*(b*x + 2*a))/x) + 1/4*sqrt(-a + c - sqrt(-b^2))*log((2*b*c* x - 2*sqrt(c*x^2 + b*x + a)*sqrt(-a + c - sqrt(-b^2))*b + b^2 - sqrt(-b^2) *(b*x + 2*a))/x)
\[ \int \frac {a-c+b x}{\left (1+x^2\right ) \sqrt {a+b x+c x^2}} \, dx=\int \frac {a + b x - c}{\left (x^{2} + 1\right ) \sqrt {a + b x + c x^{2}}}\, dx \]
\[ \int \frac {a-c+b x}{\left (1+x^2\right ) \sqrt {a+b x+c x^2}} \, dx=\int { \frac {b x + a - c}{\sqrt {c x^{2} + b x + a} {\left (x^{2} + 1\right )}} \,d x } \]
\[ \int \frac {a-c+b x}{\left (1+x^2\right ) \sqrt {a+b x+c x^2}} \, dx=\int { \frac {b x + a - c}{\sqrt {c x^{2} + b x + a} {\left (x^{2} + 1\right )}} \,d x } \]
Timed out. \[ \int \frac {a-c+b x}{\left (1+x^2\right ) \sqrt {a+b x+c x^2}} \, dx=\int \frac {a-c+b\,x}{\left (x^2+1\right )\,\sqrt {c\,x^2+b\,x+a}} \,d x \]